<div class="">
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">Tables</h1>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4>Danh sách thành viên</h4>
                </div>
                <?php if($message): ?>
                <div class="alert alert-success alert-dismissable">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                    <?php print $message; ?>
                </div>       
                <?php endif; ?>
                <!-- /.panel-heading -->
                <div class="panel-body">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>Họ tên</th>
                                    <th>Số điện thoại</th>
                                    <th>Email</th>
                                    <th>Ngày tạo</th>
                                    <th>Last login</th>
                                    <th>Nhóm</th>
                                    <th>Trạng thái</th>
                                    <th>Hành động</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach($users as $user):?>
                                <tr>
                                    <td><?php print $user['id'];?></td>
                                    <td><?php print $user['full_name'];?></td>
                                    <td><?php print $user['phone'];?></td>
                                    <td><?php print $user['email'];?></td>                                    
                                    <td><?php print $user['created_on'];?></td>
                                    <td><?php print $user['last_login'];?></td>
                                    <td><?php print $user['group_id'];?></td>
                                    <td><?php print $user['active'] ? 'Hoạt động' : 'Khóa'; ?></td>
                                    <td>                                        
                                        <div class="btn-group">
                                            <a onclick="if(!confirm('Bạn có chắc xóa không?')){return false;};"  href="<?php print BASE_URL_ADMIN . 'user/delete?id=' . $user['id'];?>" title="Xóa">
                                                <span class="fa fa-fw fa-trash-o glyphicon glyphicon-trash"></span>
                                            </a>
                                            &nbsp;&nbsp;
                                            <a href="<?php print BASE_URL_ADMIN . 'user/edit?id=' . $user['id'];?>" title="Sửa">
                                                <span class="fa fa-fw fa-edit glyphicon glyphicon-edit  icon-edit"></span>
                                            </a>
                                            &nbsp;&nbsp;
                                            <?php if($user['active']):?>
                                            <a href="<?php print BASE_URL_ADMIN . 'user/lock?id=' . $user['id'];?>" title="Khóa">
                                                <span class="fa fa-fw fa-lock"></span>
                                            </a>
                                            <?php else: ?>
                                            <a href="<?php print BASE_URL_ADMIN . 'user/active?id=' . $user['id'];?>" title="Mở khóa">
                                                <span class="glyphicon glyphicon-lock fa fa-wrench fa-fw fa-unlock-alt"></span>
                                            </a>
                                            <?php endif;?>
                                        </div>
                                    </td>
                                </tr>
                                <?php endforeach; ?>
                            </tbody>
                        </table>
                        <div class="row">
                            <div class="col-sm-6">
                                <div class="dataTables_paginate paging_simple_numbers">
                                    <?php print $pagination; ?>
                                </div>
                            </div>
                        </div>                        
                    </div>                    
                </div>
                <!-- /.panel-body -->
            </div>
            <!-- /.panel -->
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <!-- /.row -->
</div>